#pragma once 
#include <bits/stdc++.h>

/*****************************************************************************
 *! @brief C++11 提供了日期和时间相关的库, 可以很方便的处理时间.
 *
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 *  
 ****************************************************************************/


class Timer {
public:
	Timer() : m_begin(std::chrono::high_resolution_clock::now()) {}

	void reset() { 
		m_begin = std::chrono::high_resolution_clock::now(); 
	}


	int64_t elapsed() const	{
		return std::chrono::duration_cast<std::chrono::milliseconds>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}


	int64_t elapsed_micro() const	{
		return std::chrono::duration_cast<std::chrono::microseconds>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}


	int64_t elapsed_nano() const	{
		return std::chrono::duration_cast<std::chrono::nanoseconds>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}


	int64_t elapsed_seconds() const	{
		return std::chrono::duration_cast<std::chrono::seconds>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}


	int64_t elapsed_minutes() const	{
		return std::chrono::duration_cast<std::chrono::minutes>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}


	int64_t elapsed_hours() const	{
		return std::chrono::duration_cast<std::chrono::hours>(
			std::chrono::high_resolution_clock::now() - m_begin).count();
	}

private:
	std::chrono::time_point<std::chrono::high_resolution_clock> m_begin;
};

void fun() {
	// std::cout << "hello world" << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1));
}

int clock_timer();